package org.example;


import com.alibaba.nacos.api.annotation.NacosProperties;
import com.alibaba.nacos.spring.context.annotation.EnableNacos;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.data.mongo.MongoRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.RestController;

/**
 * Pandora Boot应用的入口类
 * <p>
 * 详情见http://gitlab.alibaba-inc.com/middleware-container/pandora-boot/wikis/spring-boot-diamond
 *
 * @author chengxu
 */
@ComponentScan(basePackages = {"com.youku.live", "com.youku.ddshow", "com.laifeng"},
        excludeFilters = {@ComponentScan.Filter(type = FilterType.REGEX, pattern = "com.laifeng.health.*")})
@EnableAutoConfiguration(exclude = {MongoAutoConfiguration.class, ActiveMQAutoConfiguration.class, MongoRepositoriesAutoConfiguration.class, QuartzAutoConfiguration.class})
@PropertySources({@PropertySource("classpath:/application.properties")})
@RestController
@EnableCaching
@EnableDubbo(scanBasePackages = {"com.youku", "com.laifeng"})
@EnableDiscoveryClient
@MapperScan(basePackages = "com.laifeng.b2b2c.dao")
@EnableNacos(globalProperties = @NacosProperties(serverAddr = "${spring.cloud.nacos.config.server-addr}", namespace = "${spring.cloud.nacos.config.namespace}"))
@ImportResource(value = {"classpath*:META-INF/*/applicationContext.xml", "classpath:applicationContext-city.xml"})
public class Application {

    /**
     * 应用名
     */
    public static final String APP_NAME = "laifeng-b2b2c";

    public static void main(String[] args) {
        System.setProperty("laifeng.module", APP_NAME);
        SpringApplication.run(Application.class, args);
    }
}
